home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / NDK / NDK_3.1 / Examples1 / locale / SelfLoad / helloworld_strings.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-03-17  |  2.3 KB  |  134 lines

  1. #ifndef HELLOWORLD_STRINGS_H
  2. #define HELLOWORLD_STRINGS_H
  3.  
  4.  
  5. /****************************************************************************/
  6.  
  7.  
  8. /* This file was created automatically by CatComp.
  9.  * Do NOT edit by hand!
  10.  */
  11.  
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif
  16.  
  17. #ifdef CATCOMP_ARRAY
  18. #undef CATCOMP_NUMBERS
  19. #undef CATCOMP_STRINGS
  20. #define CATCOMP_NUMBERS
  21. #define CATCOMP_STRINGS
  22. #endif
  23.  
  24. #ifdef CATCOMP_BLOCK
  25. #undef CATCOMP_STRINGS
  26. #define CATCOMP_STRINGS
  27. #endif
  28.  
  29.  
  30. /****************************************************************************/
  31.  
  32.  
  33. #ifdef CATCOMP_NUMBERS
  34.  
  35. #define MSG_HELLO 0
  36. #define MSG_BYE 1
  37.  
  38. #endif /* CATCOMP_NUMBERS */
  39.  
  40.  
  41. /****************************************************************************/
  42.  
  43.  
  44. #ifdef CATCOMP_STRINGS
  45.  
  46. #define MSG_HELLO_STR "Hello World!"
  47. #define MSG_BYE_STR "BYE!"
  48.  
  49. #endif /* CATCOMP_STRINGS */
  50.  
  51.  
  52. /****************************************************************************/
  53.  
  54.  
  55. #ifdef CATCOMP_ARRAY
  56.  
  57. struct CatCompArrayType
  58. {
  59.     LONG   cca_ID;
  60.     STRPTR cca_Str;
  61. };
  62.  
  63. static const struct CatCompArrayType CatCompArray[] =
  64. {
  65.     {MSG_HELLO,(STRPTR)MSG_HELLO_STR},
  66.     {MSG_BYE,(STRPTR)MSG_BYE_STR},
  67. };
  68.  
  69. #endif /* CATCOMP_ARRAY */
  70.  
  71.  
  72. /****************************************************************************/
  73.  
  74.  
  75. #ifdef CATCOMP_BLOCK
  76.  
  77. static const char CatCompBlock[] =
  78. {
  79.     "\x00\x00\x00\x00\x00\x0E"
  80.     MSG_HELLO_STR "\x00\x00"
  81.     "\x00\x00\x00\x01\x00\x06"
  82.     MSG_BYE_STR "\x00\x00"
  83. };
  84.  
  85. #endif /* CATCOMP_BLOCK */
  86.  
  87.  
  88. /****************************************************************************/
  89.  
  90.  
  91. struct LocaleInfo
  92. {
  93.     APTR li_LocaleBase;
  94.     APTR li_Catalog;
  95. };
  96.  
  97.  
  98. #ifdef CATCOMP_CODE
  99.  
  100. STRPTR GetString(struct LocaleInfo *li, LONG stringNum)
  101. {
  102. LONG   *l;
  103. UWORD  *w;
  104. STRPTR  builtIn;
  105.  
  106.     l = (LONG *)CatCompBlock;
  107.  
  108.     while (*l != stringNum)
  109.     {
  110.         w = (UWORD *)((ULONG)l + 4);
  111.         l = (LONG *)((ULONG)l + (ULONG)*w + 6);
  112.     }
  113.     builtIn = (STRPTR)((ULONG)l + 6);
  114.  
  115. #define XLocaleBase LocaleBase
  116. #define LocaleBase li->li_LocaleBase
  117.     
  118.     if (LocaleBase)
  119.         return(GetCatalogStr(li->li_Catalog,stringNum,builtIn));
  120. #define LocaleBase XLocaleBase
  121. #undef XLocaleBase
  122.  
  123.     return(builtIn);
  124. }
  125.  
  126.  
  127. #endif /* CATCOMP_CODE */
  128.  
  129.  
  130. /****************************************************************************/
  131.  
  132.  
  133. #endif /* HELLOWORLD_STRINGS_H */
  134.